<?php
class Model_FacultyMeetingMember extends CCMIS_Model {
    //Database faculty_meeting_member

    public function __construct(){
        parent::__construct();
        $this->load->database();
    }

    public function getAll()
    {
        $sql = "SELECT * FROM faculty_meeting_member";
        $query =  $this->db->query($sql);
        $result = $query->result_array();
        return $result;
    }

    public function add($meetingID, $memberID)
    {
        $sql = 'INSERT INTO `faculty_meeting_member`(
        `MeetingID`,
        `MemberID`
        )
        VALUES (?, ?)';

        $this->db->query($sql, array($meetingID, $memberID));
    }

    public function getByMeetingId($id)
    {
        $sql = "SELECT * FROM faculty_meeting_member WHERE MeetingID LIKE ?";
        $query =  $this->db->query($sql, $id);
        $result = $query->result_array();
        return $result;
    }

    public function getByMemberId($id)
    {
        $sql = "SELECT * FROM faculty_meeting_member WHERE MemberID LIKE ?";
        $query =  $this->db->query($sql, $id);
        $result = $query->result_array();
        return $result;
    }

}
